package jfds.clases.tokens;

public class Token {
	//tipos de Tokens
	static final int EOF=-1;
	static final int IDENTIFICADOR=0;
	static final int _F=999;
	static final int _D=998;
	static final int _I=997;
	static final int _L=996;
	static final int _E=995;
	static final int _R=994;
	static final int _N=993;
	static final int _S=992;
	static final int _V=991;
	static final int _A=990;
	static final int _U=989;
	static final int _C=988;
	static final int _W=987;
	static final int _K=986;
	static final int _00=10;
	static final int _01=1;
	static final int _02=2;
	static final int _03=3;
	static final int _04=4;
	static final int _05=5;
	static final int _06=6;
	static final int _07=7;
	static final int _08=8;
	static final int _09=9;
	static final int _P=98;
	static final int _X=97;
	static final int _guion=96;
	static final int _parenA=95;
	static final int _parenC=94;
	static final int _asterizco=93;
	static final int _punto=90;
	static final int _spaces=92;
	
	//devuelve la definicion del token
	static String toString (int id){
		switch ( id ) {
			case EOF: return "EOF";
			case _F: return "F";
			case _D: return "D";
			case _I: return "I";
			case _L: return "L";
			case _E: return "E";
			case _R: return "R";
			case _N: return "N";
			case _V: return "V";
			case _S: return "S";
			case _A: return "A";
			case _U: return "U";
			case _C: return "C";
			case _P: return "P";
			case _X: return "X";
			case _W: return "W";
			case _K: return "K";
			case _00: return "0";
			case _01: return "1";
			case _02: return "2";
			case _03: return "3";
			case _04: return "4";
			case _05: return "5";
			case _06: return "6";
			case _07: return "7";
			case _08: return "8";
			case _09: return "9";
			case IDENTIFICADOR: return "IDENTIFICADOR";
			case _guion: return "-";
			case _parenA: return "(";
			case _parenC: return ")";
			case _asterizco: return "*";
			case _punto: return ".";
			case _spaces: return "Espacios";
			default: return "";
		}
	}
	
	// Un token tiene un tipo y un valor
	int tipo;
	String Valor;
	
	//constructor
    Token(int type) {
    	this(type, toString(type));
	}

	Token(int type2, String string) {
		this.tipo = type2;
		this.Valor = string;
	}
    
	public String toString(){
		return "<"+toString(this.tipo)+","+Valor+">";
	}

}
